package com.cardbaobao.cardbabyclient.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Jiangzx on 2017/9/20 19:04.
 */

public class UserBindCards {
    private List<DebitCard> debitCardList;
    private List<CreditCard> creditCardList;

    private List<CreditCard> repaymentCardList;//信用卡还款卡列表

    public List<DebitCard> getDebitCardList() {
        return debitCardList;
    }

    /**
     * 过滤掉需要隐藏的储蓄卡
     * @param debitCardList
     */
    public void setDebitCardList(List<DebitCard> debitCardList) {
        if(debitCardList!=null){
            DebitCard debitCard;
            this.debitCardList=new ArrayList<>();
            for(int i=0,length=debitCardList.size();i<length;i++){
                debitCard=debitCardList.get(i);
                if("1".equals(debitCard.getActivation())){
                    this.debitCardList.add(debitCard);
                }
            }
        }
    }

    public List<CreditCard> getCreditCardList() {
        return creditCardList;
    }

    public List<CreditCard> getRepaymentCardList() {
        return repaymentCardList;
    }

    public void setRepaymentCardList(List<CreditCard> repaymentCardList) {
        this.repaymentCardList = repaymentCardList;
    }

    /**
     * 过滤掉需要隐藏的信用卡
     * @param creditCardList
     */
    public void setCreditCardList(List<CreditCard> creditCardList) {
        if(creditCardList!=null){
            CreditCard creditCard;
            this.creditCardList=new ArrayList<>();
            for(int i=0,length=creditCardList.size();i<length;i++){
                creditCard=creditCardList.get(i);
                if("1".equals(creditCard.getActivation())){
                    this.creditCardList.add(creditCard);
                }
            }
        }
    }

    public static class DebitCard{
        /**
         * member_id : 1
         * debit_card_name : 中国银行
         * id : b541a86fb728494c8d874dd347bf126q
         * quota : 5000.00
         * activation : 1
         * debit_card_no : 8979899491949494
         * picture : /uploadFiles/uploadImgs/banner/20170905/9ebbb987eab445e89a338c590a662965.png
         */

        private String member_id;
        private String debit_card_name;
        private String id;
        private String quota;
        private String activation;
        private String debit_card_no;
        private String picture;
        private String back_color;
        private String user_name;

        private boolean isChoose = false;

        public boolean isChoose() {
            return isChoose;
        }

        public void setChoose(boolean choose) {
            isChoose = choose;
        }

        public String getUser_name() {
            return user_name;
        }

        public void setUser_name(String user_name) {
            this.user_name = user_name;
        }

        public String getBack_color() {
            return back_color;
        }

        public void setBack_color(String back_color) {
            this.back_color = back_color;
        }

        public String getMember_id() {
            return member_id;
        }

        public void setMember_id(String member_id) {
            this.member_id = member_id;
        }

        public String getDebit_card_name() {
            return debit_card_name;
        }

        public void setDebit_card_name(String debit_card_name) {
            this.debit_card_name = debit_card_name;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getQuota() {
            return quota;
        }

        public void setQuota(String quota) {
            this.quota = quota;
        }

        public String getActivation() {
            return activation;
        }

        public void setActivation(String activation) {
            this.activation = activation;
        }

        public String getDebit_card_no() {
            return debit_card_no;
        }

        public void setDebit_card_no(String debit_card_no) {
            this.debit_card_no = debit_card_no;
        }

        public String getPicture() {
            return picture;
        }

        public void setPicture(String picture) {
            this.picture = picture;
        }
    }

    public static class CreditCard implements Parcelable {
        /**
         * member_id : 1
         * credit_card_no : 8979899494949494
         * credit_card_name : 中国银行
         * id : 7c2c15e70eb74e0fa6388ab31503eb30
         * quota : 5000.00
         * activation : 1
         * picture : /uploadFiles/uploadImgs/banner/20170905/9ebbb987eab445e89a338c590a662965.png
         */

        private String member_id;
        private String credit_card_no;
        private String credit_card_name;
        private String id;
        private String quota;
        private String activation;
        private String picture;
        private String back_color;
        private String user_name;
        private String card_type_name;

        private String latest_repayment_amount;
        private String latest_repayment_status;
        /**
         * modify_time : {"date":17,"hours":13,"seconds":37,"month":10,"nanos":0,"timezoneOffset":-480,"year":117,"minutes":40,"time":1510897237000,"day":5}
         */
        private ModifyTimeBean modify_time;



        public String getCard_type_name() {
            return card_type_name;
        }

        public void setCard_type_name(String card_type_name) {
            this.card_type_name = card_type_name;
        }

        public String getUser_name() {
            return user_name;
        }

        public void setUser_name(String user_name) {
            this.user_name = user_name;
        }

        public String getBack_color() {
            return back_color;
        }

        public void setBack_color(String back_color) {
            this.back_color = back_color;
        }

        public String getMember_id() {
            return member_id;
        }

        public void setMember_id(String member_id) {
            this.member_id = member_id;
        }

        public String getCredit_card_no() {
            return credit_card_no;
        }

        public void setCredit_card_no(String credit_card_no) {
            this.credit_card_no = credit_card_no;
        }

        public String getCredit_card_name() {
            return credit_card_name;
        }

        public void setCredit_card_name(String credit_card_name) {
            this.credit_card_name = credit_card_name;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getQuota() {
            return quota;
        }

        public void setQuota(String quota) {
            this.quota = quota;
        }

        public String getActivation() {
            return activation;
        }

        public void setActivation(String activation) {
            this.activation = activation;
        }

        public String getPicture() {
            return picture;
        }

        public void setPicture(String picture) {
            this.picture = picture;
        }

        public String getLatest_repayment_amount() {
            return latest_repayment_amount;
        }

        public void setLatest_repayment_amount(String latest_repayment_amount) {
            this.latest_repayment_amount = latest_repayment_amount;
        }

        public String getLatest_repayment_status() {
            return latest_repayment_status;
        }

        public void setLatest_repayment_status(String latest_repayment_status) {
            this.latest_repayment_status = latest_repayment_status;
        }

        public ModifyTimeBean getModify_time() {
            return modify_time;
        }

        public void setModify_time(ModifyTimeBean modify_time) {
            this.modify_time = modify_time;
        }

        public static class ModifyTimeBean implements Parcelable {
            /**
             * date : 17
             * hours : 13
             * seconds : 37
             * month : 10
             * nanos : 0
             * timezoneOffset : -480
             * year : 117
             * minutes : 40
             * time : 1510897237000
             * day : 5
             */

            private int date;
            private int hours;
            private int seconds;
            private int month;
            private int nanos;
            private int timezoneOffset;
            private int year;
            private int minutes;
            private long time;
            private int day;



            public int getDate() {
                return date;
            }

            public void setDate(int date) {
                this.date = date;
            }

            public int getHours() {
                return hours;
            }

            public void setHours(int hours) {
                this.hours = hours;
            }

            public int getSeconds() {
                return seconds;
            }

            public void setSeconds(int seconds) {
                this.seconds = seconds;
            }

            public int getMonth() {
                return month;
            }

            public void setMonth(int month) {
                this.month = month;
            }

            public int getNanos() {
                return nanos;
            }

            public void setNanos(int nanos) {
                this.nanos = nanos;
            }

            public int getTimezoneOffset() {
                return timezoneOffset;
            }

            public void setTimezoneOffset(int timezoneOffset) {
                this.timezoneOffset = timezoneOffset;
            }

            public int getYear() {
                return year;
            }

            public void setYear(int year) {
                this.year = year;
            }

            public int getMinutes() {
                return minutes;
            }

            public void setMinutes(int minutes) {
                this.minutes = minutes;
            }

            public long getTime() {
                return time;
            }

            public void setTime(long time) {
                this.time = time;
            }

            public int getDay() {
                return day;
            }

            public void setDay(int day) {
                this.day = day;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(this.date);
                dest.writeInt(this.hours);
                dest.writeInt(this.seconds);
                dest.writeInt(this.month);
                dest.writeInt(this.nanos);
                dest.writeInt(this.timezoneOffset);
                dest.writeInt(this.year);
                dest.writeInt(this.minutes);
                dest.writeLong(this.time);
                dest.writeInt(this.day);
            }

            public ModifyTimeBean() {
            }

            protected ModifyTimeBean(Parcel in) {
                this.date = in.readInt();
                this.hours = in.readInt();
                this.seconds = in.readInt();
                this.month = in.readInt();
                this.nanos = in.readInt();
                this.timezoneOffset = in.readInt();
                this.year = in.readInt();
                this.minutes = in.readInt();
                this.time = in.readLong();
                this.day = in.readInt();
            }

            public static final Creator<ModifyTimeBean> CREATOR = new Creator<ModifyTimeBean>() {
                @Override
                public ModifyTimeBean createFromParcel(Parcel source) {
                    return new ModifyTimeBean(source);
                }

                @Override
                public ModifyTimeBean[] newArray(int size) {
                    return new ModifyTimeBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.member_id);
            dest.writeString(this.credit_card_no);
            dest.writeString(this.credit_card_name);
            dest.writeString(this.id);
            dest.writeString(this.quota);
            dest.writeString(this.activation);
            dest.writeString(this.picture);
            dest.writeString(this.back_color);
            dest.writeString(this.user_name);
            dest.writeString(this.card_type_name);
            dest.writeString(this.latest_repayment_amount);
            dest.writeString(this.latest_repayment_status);
            dest.writeParcelable(this.modify_time, flags);
        }

        public CreditCard() {
        }

        protected CreditCard(Parcel in) {
            this.member_id = in.readString();
            this.credit_card_no = in.readString();
            this.credit_card_name = in.readString();
            this.id = in.readString();
            this.quota = in.readString();
            this.activation = in.readString();
            this.picture = in.readString();
            this.back_color = in.readString();
            this.user_name = in.readString();
            this.card_type_name = in.readString();
            this.latest_repayment_amount = in.readString();
            this.latest_repayment_status = in.readString();
            this.modify_time = in.readParcelable(ModifyTimeBean.class.getClassLoader());
        }

        public static final Parcelable.Creator<CreditCard> CREATOR = new Parcelable.Creator<CreditCard>() {
            @Override
            public CreditCard createFromParcel(Parcel source) {
                return new CreditCard(source);
            }

            @Override
            public CreditCard[] newArray(int size) {
                return new CreditCard[size];
            }
        };
    }
}
